home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 October / Chip Ekim 2003.iso / prog / code / contr / setup.exe / Disk1 / data1.cab / Configuration_En / Commands / EditAnchor.js < prev    next >
Encoding:
JavaScript  |  2003-07-18  |  1.2 KB  |  53 lines

  1. // Copyright 2002, 2003 Macromedia, Inc. All rights reserved.
  2.  
  3. var helpDoc = MM.HELP_objEditAnchor;
  4.  
  5. function receiveArguments()
  6. {
  7. }
  8.  
  9. function canAcceptCommand()
  10. {
  11.     if ( dw.getDocumentDOM().getCCSharedSetting_TextOnlyInNonTemplates() )
  12.         return false;
  13.     return true;
  14. }
  15.  
  16. function commandButtons()
  17. {
  18. /*   return new Array(MM.BTN_OK,         "run()",
  19.                     MM.BTN_Cancel,     "window.close()",
  20.                     MM.BTN_Help,       "displayHelp()" );
  21. */
  22.  
  23.     return new Array( "PutButtonsOnBottom", "OkButton", MM.BTN_OK, "run()",
  24.                       "PutButtonOnLeft", MM.BTN_Help,    "displayHelp()",
  25.                       "CancelButton", MM.BTN_Cancel,  "window.close()");
  26.  
  27.  
  28. }
  29.  
  30. function initializeUI()
  31. {
  32.     node = dw.getDocumentDOM().getSelectedNode();
  33.     //document.theForm.aname.value = node.name;
  34.     document.theForm.aname.value = unescape(node.name);
  35. }
  36.  
  37. function run()
  38. {
  39.     var errStr = CheckEditAnchor( node.name, document.theForm.aname.value );
  40.     if ( errStr.length < 1 )
  41.     {
  42.         node = dw.getDocumentDOM().getSelectedNode();
  43.         //node.name = document.theForm.aname.value;
  44.         node.name = dw.doURLEncoding(document.theForm.aname.value);
  45.         window.close();
  46.     }
  47.     else
  48.     {
  49.         alert( errStr );
  50.         document.theForm.aname.focus();
  51.     }
  52. }
  53.